Returning JSON from a PHP Script

38

<?php
$data = /** whatever you're serializing **/;
header('Content-Type: application/json; charset=utf-8');
echo json_encode($data);

Comments

Submit
0 Comments